<?php 
/**
 * FCKeditor adapter for XOOPS
 *
 * @copyright	The XOOPS project http://www.xoops.org/
 * @license		http://www.fsf.org/copyleft/gpl.html GNU public license
 * @author		Taiwen Jiang (phppp or D.J.) <php_pp@hotmail.com>
 * @since		4.00
 * @version		$Id$
 * @package		xoopseditor
 */
include_once "../../mainfile.php";
$dirname = basename( dirname( __FILE__ )) ;
$fckmodule_handler = xoops_gethandler('module');
$fckmodule = $fckmodule_handler->getByDirname('fckeditor');
if (is_object($fckmodule) && $fckmodule->getVar('isactive') == 1) {
  $fckconfig_handler = xoops_gethandler('config');
	$fckconfig = $fckconfig_handler->getConfigList($fckmodule->getVar('mid'));
	if (!empty($fckconfig['fck_userdir'])) {
	  if (intval($fckconfig['fck_userdir']) == 1 && $xoopsUser) {
		  $ufolder = "user-".$xoopsUser->getVar('uid');
			define("XOOPS_FCK_FOLDER", $ufolder);
		}
	}
}
if (is_readable(XOOPS_ROOT_PATH."/class/xoopseditor/fckeditor/editor/filemanager/upload/php/upload.php"))
  include XOOPS_ROOT_PATH."/class/xoopseditor/fckeditor/editor/filemanager/upload/php/upload.php";
elseif (is_readable(XOOPS_ROOT_PATH."/class/xoopseditor/FCKeditor/editor/filemanager/upload/php/upload.php"))
  include XOOPS_ROOT_PATH."/class/xoopseditor/FCKeditor/editor/filemanager/upload/php/upload.php";
?>